import {
  request
} from '../../request/index'
import regeneratorRuntime from '../../lib/runtime/runtime'

Page({

  data: {
    videoUrl:"",
    danmuList:
    [{
      text: '第 1s 出现的弹幕',
      color: '#ff0000',
      time: 1
    }, {
      text: '第 3s 出现的弹幕',
      color: '#ff00ff',
      time: 3
    }],
  },

  onLoad: function (options) {
    this.getVideoUrl(options.id)
  },

    //获取视频url
    async getVideoUrl(id){
      let {data:{urls}} = await request({url:"/video/url",data:{id:id}})
      this.setData({
        videoUrl:urls[0].url
      })
    }

})